package supermarket;

import java.util.Date;

public class ProductFactory {
	private Date stateDate;
	
	public ProductFactory(){
		setStateDate(new Date());
	}
	
	public Product createProduct(String name, String brand, String externalReference, Distributor distributor){
		Date timestamp = new Date();
		return new Product(name, brand, externalReference, getStateDate(), timestamp, distributor);
	}
	public Product createProduct(String name, String brand, String externalReference, Date stateDate, Distributor distributor){
		Date timestamp = new Date();
		return new Product(name, brand, externalReference, stateDate, timestamp, distributor);
	}
	
	public Date getStateDate() {
		return stateDate;
	}
	public void setStateDate(Date stateDate) {
		this.stateDate = stateDate;
	}
}
